package com.woniu.liuzhougov.fileManage.constant;

import com.woniu.liuzhougov.businessproject.vo.BusinessProjectUploadVO;
import com.woniu.liuzhougov.fileManage.pojo.FileData;
import com.woniu.liuzhougov.relatedinformation.pojo.RelatedInformation;

/**
 * @description: 信息
 * @author: Arvin
 * @create: 2019-04-26 15:26
 **/
public class SysConstant {

    //判断文件是否上传成功
    public static boolean isInsert = false;

//    public static String path = "E:/woniuClass/upload";

    private static Integer fileTypeId = 0;

    private static Integer itemId = 0;

    private static String fileState = "false";

    private static String fileContent = "内容";

    public static Integer code = 200;

    public static Integer fileDataId = 0;

    public static void setFileData(FileData fileData){
        System.out.println("setFileData..."+fileData);
        fileTypeId = fileData.getFileTypeId();
        itemId = fileData.getItemId();
        fileState = fileData.getFileState();
        fileContent = fileData.getFileContent();
    }

    public static void setFileDataId(BusinessProjectUploadVO fileData){
        System.out.println("setFileData..."+fileData);
        fileTypeId = fileData.getFileTypeId();
        itemId = fileData.getItemId();
        fileState = fileData.getFileState();
        fileContent = fileData.getFileContent();
        fileDataId = fileData.getBusinessProjectId();
    }

    public static void setRelatedInformationFileDataId(RelatedInformation fileData){
        System.out.println("setFileData..."+fileData);
        fileTypeId = fileData.getFileTypeId();
        itemId = fileData.getItemId();
        fileState = fileData.getFileState();
        fileContent = fileData.getFileContent();
        fileDataId = fileData.getRelatedInformationId();
    }


    public synchronized static FileData getFileData(){
        FileData fileData = new FileData(fileTypeId, itemId,fileState,fileContent);
        return fileData;
    }
}
